<template>
  <div class="setting-container nav-bar-top">
    <!-- 导航栏 -->
    <van-nav-bar class="nav-bar" title="系统设置" left-arrow @click-left="$router.back()"/>
    <van-cell-group :border="false" class="setting circle-bg">
      <van-cell title="意见反馈" is-link @click="$router.push('/problem')"/>
      <van-cell title="地址管理" is-link @click="$router.push('/address')"/>
      <van-cell title="修改密码" is-link @click="$router.push('/password')"/>
      <van-cell title="关于我们" is-link @click="$router.push('/aboutus')"/>
      <van-cell title="当前版本">
        <div slot="default">
          1.0.0
        </div>
      </van-cell>
      <van-cell title="退出登录" is-link @click="logout"/>
    </van-cell-group>
  </div>
</template>

<script>
import constants from '@/config/constants'

export default {
  name: 'setting',
  data () {
    return {

    }
  },
  methods: {
    logout () {
      this.$dialog.confirm({
        title: '',
        message: '确认退出当前账号'
      })
      .then(() => {
        this.$store.commit(constants.STORE.CLEAR_USER);
        this.$store.commit(constants.STORE.CLEAR_CART_LIST);
        this.$router.back();
      })
    }
  }
}
</script>

<style lang="scss">
.setting-container{
  padding-top: 5px;
  .setting{
    .van-cell{
      padding: 15px 0px;
    }
  }
}
</style>
